package com.fly.security.router

import com.fly.security.handler.UserHandler
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories
import org.springframework.web.reactive.function.server.coRouter

/**
 * @author  fly
 * @date  2021/7/29 18:17
 * @version 1.0
 */
@Configuration
@EnableR2dbcRepositories
class AppRouter {

    @Bean
    fun userRoute(userHandler: UserHandler) = coRouter {
        GET("/users", userHandler::findAll)
        POST("saveUser", userHandler::saveUser)
    }
}